﻿
CREATE PROCEDURE [dbo].[exbug_FiltreazaOrdonantari] 
	-- Add the parameters for the stored procedure here
	@filtru varchar(500),
	@an varchar(4)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
	DECLARE @sel varchar(2000)
	SET @sel = 'SELECT * FROM [Ordonantari'+@an+'] where ' +@filtru 
	EXEC(@sel)
END